<?php
/**
 * Joomla! 1.5 component PB-Roster
 *
 * @version $Id: pbroster.php 2010-09-10 10:03:33 svn $
 * @author ML@pixelbyte.dk
 * @package Joomla
 * @subpackage PB-Roster
 * @copyright (C) 2010- pixelbyte.dk
 * @license GNU/GPL
 *
 * A World of Warcraft Guild Roster
 *
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
  
// Char Roster
$char_roster = dirname(__FILE__).DS.'/char_roster/char_roster.php';
$char_roster_db = dirname(__FILE__).DS.'/char_roster/char_roster_db.php';
$char_roster_helper = dirname(__FILE__).DS.'/char_roster/char_roster_helper.php';
if (file_exists($char_roster))
  include_once ($char_roster);
if (file_exists($char_roster_db))
  include_once ($char_roster_db);
if (file_exists($char_roster_helper))
  include_once ($char_roster_helper);
  
// PHPBB Avatar
$phpbb_avatar = dirname(__FILE__).DS.'/phpbb_avatar/phpbb_avatar.php';
$phpbb_avatar_db = dirname(__FILE__).DS.'/phpbb_avatar/phpbb_avatar_db.php';
if (file_exists($phpbb_avatar))
  include_once ($phpbb_avatar);
if (file_exists($phpbb_avatar_db))
  include_once ($phpbb_avatar_db);
  
// Quotes
$quotes = dirname(__FILE__).DS.'/quotes/quotes.php';
$quotes_db = dirname(__FILE__).DS.'/quotes/quotes_db.php';
if (file_exists($quotes))
  include_once ($quotes);
if (file_exists($quotes_db))
  include_once ($quotes_db);


function countPlugins() {
  $num = 0;
  $char_roster = dirname(__FILE__).DS.'/char_roster/char_roster.php';
  $phpbb_avatar = dirname(__FILE__).DS.'/phpbb_avatar/phpbb_avatar.php';
  $quotes = dirname(__FILE__).DS.'/quotes/quotes.php';

  if (file_exists($char_roster))
    $num++;
  if (file_exists($phpbb_avatar))
    $num++;
  if (file_exists($quotes))
    $num++;
	
  return $num;
}

function getPlugin($name) {
  if (file_exists(dirname(__FILE__).DS.$name.'/'.$name.'.php'))
    return true;
  else
    return false;
}

?>